<h5 class="sidebartitle">运营后台导航栏</h5>

<ul class="nav nav-pills nav-stacked nav-bracket">

    <?php $menulist = C('MENU_LIST'); ?>

    <?php foreach($menulist as $m=>$v): ?>

    <?php if(isset($v['need']) && !C($v['need'])) continue; ?>
    
    <li class="<notempty name="v.child">nav-parent</notempty> <eq name="m" value="$controller_name">active</eq>">
        <a href="<?php echo !$v['child'] ? '/' . $m : 'javascript:;'; ?>"><i class="fa <?php echo $v['icon']; ?>"></i><span><?php echo $v['text']; ?></span></a>
    
        <?php if($v['child']): ?>

        <ul class="children" <eq name="m" value="$controller_name">style="display:block"</eq>>
            <?php foreach($v['child'] as $a=>$text): ?>
            <?php if($m == $controller_name && $a == $action_name): ?>
            <li class="active"><a href="/{$m}<neq name="a" value="index">/{$a}</neq>"><i class="fa fa-caret-right"></i><span>{$text}</span></a></li>
            <?php else: ?>
            <li><a href="/{$m}<neq name="a" value="index">/{$a}</neq>"><i class="fa fa-caret-right"></i><span>{$text}</span></a></li>
            <?php endif; ?>
            <?php endforeach; ?>
        </ul>
        
        <?php endif; ?>
    </li>
    
    <?php endforeach; ?>
</ul>
